function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = model_6_IRFs.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(46, 66);
g1(1,43)=1;
g1(1,47)=(-T(52));
g1(2,24)=(-T(27));
g1(2,45)=1;
g1(2,47)=(-T(26));
g1(2,5)=(-T(28));
g1(3,24)=(-T(30));
g1(3,44)=1;
g1(3,47)=(-T(29));
g1(3,5)=(-T(31));
g1(4,24)=(-T(33));
g1(4,2)=(-(T(35)*T(50)));
g1(4,36)=(-(T(35)*T(51)));
g1(4,46)=1;
g1(4,47)=(-T(32));
g1(4,5)=(-T(34));
g1(5,55)=(-(T(5)*(y(60)*params(10)*(1-params(9))+y(61)*(1-params(8))*params(12)*params(9)*params(10)+y(62)*params(14)*params(9)*params(10))));
g1(5,56)=(-(params(1)/y(58)*(1-params(4))*T(6)));
g1(5,40)=(-1)/(y(40)*y(40));
g1(5,58)=(-(T(6)*y(56)*(1-params(4))*(-params(1))/(y(58)*y(58))+(-(params(1)*(1-params(8))))/(y(58)*y(58))));
g1(5,60)=(-(T(5)*y(55)*params(10)*(1-params(9))));
g1(5,61)=(-(T(5)*params(12)*params(9)*y(55)*params(10)*(1-params(8))));
g1(5,62)=(-(T(5)*params(14)*params(9)*y(55)*params(10)));
g1(6,57)=(-((1+y(59))*(-(params(1)/y(58)))/((1+y(57))*(1+y(57)))));
g1(6,40)=(-1)/(y(40)*y(40));
g1(6,58)=(-((1+y(59))*(-params(1))/(y(58)*y(58))/(1+y(57))));
g1(6,59)=(-T(7));
g1(7,24)=(-(params(3)*1/y(54)/(1-params(3))*T(36)));
g1(7,40)=1;
g1(7,54)=(-(params(3)*T(36)*(-y(24))/(y(54)*y(54))/(1-params(3))));
g1(8,26)=getPowerDeriv(y(26),(-params(2)),1);
g1(8,40)=(-((-(params(6)/(1-params(5))))/(y(40)*y(40))));
g1(9,24)=(-(y(2)*T(38)));
g1(9,2)=(-(T(9)+y(2)*T(37)*T(50)));
g1(9,36)=(-(y(2)*T(37)*T(51)-y(42)));
g1(9,40)=y(48)/params(6);
g1(9,42)=y(36);
g1(9,48)=y(40)/params(6);
g1(9,5)=(-(y(2)*T(39)));
g1(10,17)=1;
g1(10,48)=(-(0.5*1/y(48)/params(21)/1.414213562373095*2/(exp(T(10)^2)*1.772453850905516)));
g1(11,29)=1;
g1(11,48)=(-T(53));
g1(12,1)=(-(y(3)*(1+y(6))));
g1(12,17)=y(36)*(1+y(30));
g1(12,30)=y(36)*y(17);
g1(12,3)=(-(y(1)*(1+y(6))));
g1(12,36)=y(17)*(1+y(30));
g1(12,6)=(-(y(1)*y(3)));
g1(13,30)=(-(1+y(41)));
g1(13,41)=(-(1+y(30)));
g1(13,4)=1;
g1(14,24)=(-(y(44)*params(9)*(1-params(4))*params(10)));
g1(14,42)=1;
g1(14,44)=(-(params(9)*params(10)*y(24)*(1-params(4))));
g1(15,24)=y(47)*(1-params(4));
g1(15,2)=(-T(50));
g1(15,36)=(-T(51));
g1(15,47)=y(24)*(1-params(4));
g1(15,5)=(-(1-params(8)));
g1(16,17)=(-(T(12)*y(2)*params(10)));
g1(16,24)=(-(y(2)*params(10)*y(17)*T(41)));
g1(16,2)=(-(params(10)*y(17)*T(12)+y(2)*params(10)*y(17)*T(43)*T(50)));
g1(16,36)=(-(y(2)*params(10)*y(17)*T(43)*T(51)));
g1(16,39)=1;
g1(16,47)=(-(y(2)*params(10)*y(17)*T(40)));
g1(16,5)=(-(y(2)*params(10)*y(17)*T(42)));
g1(17,17)=(-(T(13)*y(2)*params(10)));
g1(17,24)=(-(y(2)*params(10)*y(17)*T(45)));
g1(17,2)=(-(params(10)*y(17)*T(13)));
g1(17,38)=1;
g1(17,47)=(-(y(2)*params(10)*y(17)*T(44)));
g1(17,5)=(-(y(2)*params(10)*y(17)*T(46)));
g1(18,27)=y(31);
g1(18,31)=y(39)+y(38)+y(27);
g1(18,38)=y(31)-1;
g1(18,39)=y(31)-1;
g1(19,32)=y(39)+y(38);
g1(19,38)=y(32);
g1(19,39)=y(32)-1;
g1(20,17)=(-(y(43)*y(2)*params(10)+y(46)*y(2)*params(10)));
g1(20,25)=1;
g1(20,2)=(-(params(52)+y(43)*params(10)*y(17)+y(46)*params(10)*y(17)));
g1(20,43)=(-(y(2)*params(10)*y(17)));
g1(20,46)=(-(y(2)*params(10)*y(17)));
g1(21,26)=(-1);
g1(21,28)=1;
g1(21,2)=1-params(8);
g1(21,35)=(-1);
g1(21,53)=(-1);
g1(22,24)=(-(y(25)/(1-params(3))));
g1(22,25)=(-(y(24)/(1-params(3))));
g1(22,28)=1;
g1(23,27)=1;
g1(23,2)=1-params(8);
g1(23,35)=(-1);
g1(24,25)=(-T(15));
g1(24,37)=1;
g1(24,40)=(-(y(25)*y(54)*(-params(3))/(y(40)*y(40))*getPowerDeriv(params(3)/y(40),1/(1-params(3)),1)));
g1(24,54)=(-(y(25)*T(14)));
g1(25,28)=(-1);
g1(25,33)=T(19)*T(16)*T(18);
g1(25,2)=T(19)*T(17)*getPowerDeriv(y(2),1-params(3),1);
g1(25,37)=T(17)*T(18)*getPowerDeriv(y(37),params(3),1);
g1(25,54)=T(19)*T(18)*T(54);
g1(26,33)=(-T(16));
g1(26,34)=1;
g1(26,54)=(-T(54));
g1(27,24)=(-T(48));
g1(27,47)=(-T(47));
g1(27,49)=1;
g1(27,5)=(-T(49));
g1(28,17)=(-(params(10)*T(25)));
g1(28,24)=(-T(23));
g1(28,47)=(-T(22));
g1(28,50)=1;
g1(28,5)=(-T(24));
g1(29,20)=1;
g1(29,40)=(-(1/y(40)));
g1(30,16)=1;
g1(30,30)=(-(1/(1+y(30))));
g1(31,22)=1;
g1(31,42)=(-1);
g1(32,14)=1;
g1(32,31)=(-(1/y(31)));
g1(33,15)=1;
g1(33,32)=(-(1/y(32)));
g1(34,23)=1;
g1(34,33)=(-(1/y(33)));
g1(35,13)=1;
g1(35,34)=(-(1/y(34)));
g1(36,21)=1;
g1(36,36)=(-(1/y(36)));
g1(37,9)=1;
g1(37,28)=(-(1/(y(28)+y(40)*y(29)*params(15)-y(53))));
g1(37,29)=(-(y(40)*params(15)/(y(28)+y(40)*y(29)*params(15)-y(53))));
g1(37,40)=(-(y(29)*params(15)/(y(28)+y(40)*y(29)*params(15)-y(53))));
g1(37,53)=(-((-1)/(y(28)+y(40)*y(29)*params(15)-y(53))));
g1(38,11)=1;
g1(38,27)=(-(1/y(27)));
g1(39,10)=1;
g1(39,26)=(-(1/(y(26)+y(40)*y(29)*params(15))));
g1(39,29)=(-(y(40)*params(15)/(y(26)+y(40)*y(29)*params(15))));
g1(39,40)=(-(y(29)*params(15)/(y(26)+y(40)*y(29)*params(15))));
g1(40,12)=1;
g1(40,29)=(-(1/(y(29)+y(37))));
g1(40,37)=(-(1/(y(29)+y(37))));
g1(41,19)=1;
g1(41,49)=(-(1/y(49)));
g1(42,18)=1;
g1(42,50)=(-(1/y(50)));
g1(43,5)=(-(params(22)*1/y(5)));
g1(43,51)=1/y(51);
g1(43,63)=(-params(26));
g1(44,6)=(-(params(24)*1/(1+y(6))));
g1(44,52)=1/(1+y(52));
g1(44,65)=params(28);
g1(45,8)=(-(params(23)*1/y(8)));
g1(45,54)=1/y(54);
g1(45,64)=(-params(27));
g1(46,7)=(-(params(25)*1/y(7)));
g1(46,53)=1/y(53);
g1(46,66)=(-params(29));

end
